Nonstop systems are highly scalable, fault-tolerant database systems that are capable of analyzing large amounts of data. Nonstop SQL/MX is a state of the art database management system that is designed to handle complex database queries.
A SQL/MX compiler consists of several phases to generate an efficient execution plan. First, a query is passed to a parser where syntactic checking is performed and an initial query tree is built. Next, a binder performs semantic checks and binds query variables to database objects. This is followed by a normalizer phase where subquery transformation and other unconditional query transformations take place. The normalizer transforms the query into a canonical tree form before passing it to an optimizer to determine the execution strategy (i.e., the plan). The optimization search space is determined by the set of transformation and implementation rules used by the optimizer. Rules are applied recursively to the initial normalized tree transforming it into semantically equivalent query trees. The transitive closure of the rules applications defines the optimization search space. The optimizer output is a single plan with the lowest cost among all traversed plans in the search space, based on the optimizer's cost model.